package com.how2java.tmall.web;

import com.how2java.tmall.feign.OrderFeignService;
import com.how2java.tmall.pojo.User;
import com.how2java.tmall.service.UserService;
import com.how2java.tmall.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class TestController {
    @GetMapping(value = "/testC")
    public String editCategory() {
        return "test";
    }

    @GetMapping(value = "/index")
    public String indexPage() {
        return "admin/index";
    }

    @Autowired
    OrderFeignService orderFeignService;

    @RequestMapping(value = "/order")
    @ResponseBody
    public String orderController(){
        return orderFeignService.orderController();
    }

    @GetMapping(value = "/user")
    public String testUser() {
        return "/user/detail";
    }


    @PostMapping(value = "/userTest")
    public String user(@RequestBody User user) {
        String name = user.getName();
        System.out.println(name + "=====");
        return name;
    }


}
